/* tizp - A lisp interpreter */
#include "main.h"

int main(int argc, char **argv)
{
    Tizp lisp(new tizp());

    if (argc == 2 && std::string("-h") == argv[1]) {
	std::cout << "tizp - A lisp interpreter" << std::endl << std::endl;
	std::cout << "Usage: " << argv[0] << " [Options]" << std::endl;
	std::cout << "Options: -h         Print usage and versions." << std::endl;
	std::cout << "         [Filename] loaf file at loading." << std::endl;
	return 0;
    } else if (argc == 2)
	try {
	    lisp->set_port(argv[1]);
	    lisp->start();
	} catch (Error err) {
	    std::cout << "Error: " << err->msg << "." << std::endl;
	}
    lisp->set_port("stdin");
    lisp->start();
    return 0;
}
